<template>
  <div class="wrap">
    <Navbar appTitle="车间物料需求详情" />
    <div class="wrap">
      <div class="head">
        <p class="title">
          <span>物料编号：</span>
          <span>{{ detailData.goodsCode || '--' }}</span>
        </p>
        <p class="content">
          <span class="key">物料名称：</span>
          <span class="value">{{ detailData.goodsName || '--' }}</span>
        </p>
        <p class="content">
          <span class="key">物料规格：</span>
          <span class="value"
            >{{ detailData.spec || '--' }}</span
          >
        </p>
      </div>
      <div class="box">
        <div class="title">
          <span class="icon"></span>
          <span class="titlekey">需求总览</span>
        </div>
        <div class="body">
          <p class="content">
            <span class="key">需求总量：</span>
            <span class="value" style="color: #1890ff">{{ detailData.totalNumText || '--' }}</span>
          </p>
          <p class="content">
            <span class="key">已出库数量：</span>
            <span class="value">{{ detailData.yetOutStockNumText || '--' }}</span>
          </p>
          <p class="content">
            <span class="key">账面合格品库存：</span>
            <span class="value">{{ detailData.currentRepertoryNumText || '--' }}</span>
          </p>
          <p class="content">
            <span class="key">净需求量：</span>
            <span class="value" style="color: #ff4d4f">{{
              detailData.netRequirementNumText || '--'
            }}</span>
          </p>
        </div>
      </div>
      <div class="box">
        <div class="title">
          <span class="icon"></span>
          <span class="titlekey">使用信息</span>
        </div>
        <div class="body">
          <p class="content">
            <span class="key">最近使用时间：</span>
            <span class="value">{{ detailData.recentlyUseTime || '--' }}</span>
          </p>
        </div>
      </div>
      <div class="box">
        <div class="title">
          <span class="icon"></span>
          <span class="titlekey">采购信息</span>
        </div>
        <div class="body">
          <p class="content">
            <span class="key">采购中任务：</span>
            <span class="value">{{ detailData.beingPurchaseTask || '--' }}</span>
          </p>
          <p class="content">
            <span class="key">待采购任务：</span>
            <span class="value">{{ detailData.notPurchaseTask || '--' }}</span>
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Navbar from "@/components/navBar/navBar_right";
import moment from "moment";
import { getAction } from "@/api/manage";
export default {
  components: { Navbar },
  data() {
    return {
      moment,
      detailData: {},
      active: 0,
      type: this.$route.query.type,
    };
  },
  computed: {},
  mounted() {},
  created() {
    getAction("/planmgt/erpProductMaterialRequirement/summaryInfo", {
      goodsId: this.$route.query.goodsId,
    }).then((res) => {
      console.log(res, "详情");
      this.detailData = res.result || {};
    });
  },
  methods: {
    change(v) {
      console.log(v, this.active, "111");
    },
  },
};
</script>
<style lang="scss" scoped>
@import "@/assets/detail.scss";
</style>